﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using GeoWeb.DataContext;

namespace GeoWeb.Demo.DataContext
{
    /// <summary>
    /// 数据操作基类
    /// add by zhangyu 
    /// 2013.01.14
    /// </summary>
    public class DbUtity
    {
        /// <summary>
        /// 数据操作对象
        /// </summary>
        DbSession _db = null;

        /// <summary>
        /// 数据操作对象
        /// </summary>
        public DbSession Db
        {
            get
            {
                if (_db == null)
                {
                    DbProvider Provider = ProviderFactory.CreateDbProvider("sqlconn", ProviderType.SqlServer9);
                    _db = new DbSession(Provider);
                }
                return _db;
            }
        }

        /// <summary>
        /// 数据操作对象
        /// </summary>
        DbSession _db_Syupb = null;

        /// <summary>
        /// 数据操作对象
        /// </summary>
        public DbSession Db_Syupb
        {
            get
            {
                if (_db_Syupb == null)
                {
                    DbProvider Provider = ProviderFactory.CreateDbProvider("syupbconn", ProviderType.SqlServer9);
                    _db_Syupb = new DbSession(Provider);
                }
                return _db_Syupb;
            }
        }
    }
}